/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ADMINISTRADOR
 */
@Entity
@Table(name = "col_deporte")
//@NamedQueries({@NamedQuery(name = "Deporte.findAll", query = "SELECT d FROM Deporte d"), @NamedQuery(name = "Deporte.findByDepCodigo", query = "SELECT d FROM Deporte d WHERE d.depCodigo = :depCodigo"), @NamedQuery(name = "Deporte.findByDepDescripcion", query = "SELECT d FROM Deporte d WHERE d.depDescripcion = :depDescripcion")})
public class Deporte implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "dep_codigo")
    private Integer depCodigo;
    @Basic(optional = false)
    @Column(name = "dep_descripcion")
    private String depDescripcion;
   
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "depCodigo", fetch = FetchType.LAZY)
    private List<ColegiadoDeporte> colegiadoDeporteCollection;

    public Deporte() {
    }

    public Deporte(Integer depCodigo) {
        this.depCodigo = depCodigo;
    }

    public Deporte(Integer depCodigo, String depDescripcion) {
        this.depCodigo = depCodigo;
        this.depDescripcion = depDescripcion;
    }

    public Integer getDepCodigo() {
        return depCodigo;
    }

    public void setDepCodigo(Integer depCodigo) {
        this.depCodigo = depCodigo;
    }

    public String getDepDescripcion() {
        return depDescripcion;
    }

    public void setDepDescripcion(String depDescripcion) {
        this.depDescripcion = depDescripcion;
    }

    public List<ColegiadoDeporte> getColegiadoDeporteCollection() {
        return colegiadoDeporteCollection;
    }

    public void setColegiadoDeporteCollection(List<ColegiadoDeporte> colegiadoDeporteCollection) {
        this.colegiadoDeporteCollection = colegiadoDeporteCollection;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (depCodigo != null ? depCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Deporte)) {
            return false;
        }
        Deporte other = (Deporte) object;
        if ((this.depCodigo == null && other.depCodigo != null) || (this.depCodigo != null && !this.depCodigo.equals(other.depCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.colegiatura.be.Deporte[depCodigo=" + depCodigo + "]";
    }

}
